﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Workflow2211A.Domain.Entities
{
    /// <summary>
    /// 流程实例业务表
    /// </summary>
    [Table("WorkflowInstance")]
    public class WorkflowInstanceModel:BaseEntity
    {
        //与Workflow是什么关系？ 答：一对一的
        /// <summary>
        /// 流程ID
        /// </summary>
        [MaxLength(100),Required]
        public string WorkflowId { get; set; }
        /// <summary>
        /// 流程设计ID
        /// </summary>
        [MaxLength(100),Required]

        public string DefinitionId { get; set; }
        
        /// <summary>
        /// 流程标题
        /// </summary>
        [MaxLength(100),Required]

        public string Title { get; set; }
        /// <summary>
        /// 申请人
        /// </summary>
        [MaxLength(100),Required]

        public string ApplicantUserName { get; set; }
        /// <summary>
        /// 步骤名称
        /// </summary>
        [MaxLength(100),Required]
        public string StepName { get; set; }
        /// <summary>
        /// 步骤ID
        /// </summary>
        [MaxLength(100), Required]
        public string StepId { get; set; }
        /// <summary>
        /// 审批人名称
        /// </summary>
        [MaxLength(300),Required]
        public string AuditUserName { get; set; }
        /// <summary>
        /// 审批人（多人之间与逗号隔开）
        /// </summary>
        [MaxLength(300),Required]
        public string AuditUserId { get; set; }
        /// <summary>
        /// 发起/处理中/通过/驳回/
        /// </summary>
        [MaxLength(30),Required]
        public string Status { get; set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? CompleteTime { get; set; }
        /// <summary>
        /// 流程发起时，存储的是具体的表单数据
        /// </summary>
        [Column(TypeName ="Json")]
        public string FormData { get; set; }

    }
}
